package main

import (
	"fmt"
	"io/ioutil"
	"net/http"
)

type indexHandler struct {
	content string
}

func (ih *indexHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	defer r.Body.Close()

	b, _ := ioutil.ReadAll(r.Body)
	fmt.Println(string(b))
	fmt.Fprintf(w, ih.content)
}
func main() {
	http.Handle("/", &indexHandler{content: "hello world!"})
	http.ListenAndServe("0.0.0.0:8089", nil)
}
